package com.zhz;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author ：zhz
 * @date ：Created in 2021/02/06
 * @version: V1.0
 * @slogan: 天下风云出我辈，一入代码岁月催
 * @description:
 **/
@Component
public class RabbitMQListener {
    //监听队列
    @RabbitListener(queues = "boot_queue")
    public void ListenerQueue(Message message){
        System.out.println("监听到的数据:"+message.getBody());
        System.out.println("监听到的数据:"+message.getMessageProperties().getDeliveryTag());
    }
}
